<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php $this->pageTitle="文件管理"; ?>
<?php
	$message = Yii::app()->request->getParam("message");
	if(isset($message) && $message!=''){
		echo("<div id='message' class='updated'><p>".$message."。</p></div>");
	}
	?>
<?php
$allClass = "";
$officeClass = "";
$imageClass = "";
$deletedClass="";

if(Yii::app()->request->getParam("office")!=''){
	$officeClass = "current";
}
else if(Yii::app()->request->getParam("image")!=''){
	$imageClass = "current";
}
else if(Yii::app()->request->getParam("trash")!=''){
	$deletedClass = "current";
}
else {
	$allClass = "current";
}
?>
<div class="icon32 icon32-posts-post" id="icon-edit"><br></div>
<?php $arr = Yii::app()->params['helpDocument'];?>
<h2>文件管理<a target="<?php echo $arr['target']?>" href="<?php echo $arr['manageFile']?>"><?php echo $arr['img']?></a></h2>
<ul class="subsubsub">
	<li class="all"><a class="<?php echo($allClass);?>"
		href="<?php echo(Yii::app()->createUrl("adminFilePanel/index"));?>">全部
	<span class="count">(<?php echo($count);?>)</span></a> |</li>
	<li class="administrator"><a class="<?php echo($officeClass);?>"
		href="<?php echo(Yii::app()->createUrl("adminFilePanel/office&office=1"));?>">办公文档
	<span class="count">(<?php echo($officeCount);?>)</span></a> |</li>
	<li class="administrator"><a class="<?php echo($imageClass);?>"
		href="<?php echo(Yii::app()->createUrl("adminFilePanel/image&image=1"));?>">图片
	<span class="count">(<?php echo($imageCount);?>)</span></a> |</li>
	<li class="administrator"><a class="<?php echo($deletedClass);?>"
		href="<?php echo(Yii::app()->createUrl("adminFilePanel/trash&trash=1"));?>">回收站
	<span class="count">(<?php echo($deletedCount);?>)</span></a></li>
</ul>
<?php
$form=$this->beginWidget('CActiveForm', array(
'id'=>'file-form'
));
$dataProvider = $model->getDataProvider();
$count = count($dataProvider->getData());
?>

<?php echo $form->hiddenField($model,"action");?>
<p class="search-box"><?php echo $form->textField($model,"searchKey");?>
<?php echo CHtml::submitButton("搜索文件",array("class"=>"button","name"=>"search")); ?>

<?php if($count>0):?>
<div class="tablenav top">
	<?php if($deletedClass!==''):?>
    	<div class="alignleft actions"><?php echo $form->dropDownList($model,"revertAction",$model->revertActionArray) ?></div>
        <div class="alignleft actions"><?php echo CHtml::submitButton("应用",array("class"=>"button-secondary action","name"=>"revertAction")); ?></div>
	<?php else:?>
	    <div class="alignleft actions"><?php echo $form->dropDownList($model,"removeAction",$model->removeActionArray) ?></div>
		<div class="alignleft actions"><?php echo CHtml::submitButton("应用",array("class"=>"button-secondary action","name"=>"removeAction")); ?></div>
	<?php endif;?>
<?php endif; ?>

<?php $this->widget('CMiniyunGridView', array(
	'id'           => 'file-grid',
	'dataProvider' => $dataProvider,
	'model'        => new FileBase(),
	'view'         => 'miniyunGridView',
	)); ?>
<?php $this->endWidget(); ?>
<script
	type='text/javascript'
	src='<?php echo Yii::app()->request->baseUrl; ?>/statics/javascript/fileList.js'></script>
</div>